var t = require;
var e = module;
var o = exports;
var a,
    i =
        (this && this.__extends) ||
        ((a = function (t, e) {
            return (a =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (t, e) {
                        t.__proto__ = e;
                    }) ||
                function (t, e) {
                    for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                })(t, e);
        }),
        function (t, e) {
            a(t, e);
            function o() {
                this.constructor = t;
            }
            t.prototype = null === e ? Object.create(e) : ((o.prototype = e.prototype), new o());
        }),
    n =
        (this && this.__decorate) ||
        function (t, e, o, a) {
            var i,
                n = arguments.length,
                r = n < 3 ? e : null === a ? (a = Object.getOwnPropertyDescriptor(e, o)) : a;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, a);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (i = t[s]) && (r = (n < 3 ? i(r) : n > 3 ? i(e, o, r) : i(e, o)) || r);
            return n > 3 && r && Object.defineProperty(e, o, r), r;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var r = t("BaseDlgNode"),
    s = cc._decorator,
    c = s.ccclass,
    p = s.property,
    l =
        (s.menu,
        (function (t) {
            i(e, t);
            function e() {
                var e = (null !== t && t.apply(this, arguments)) || this;
                e.unlockBtn = null;
                e.btnLockLab = null;
                return e;
            }
            e.prototype.unLockLevel = function () {
                var t = CacheDataManager.getCoinCount(),
                    e = CacheDataManager.getFoodLevel(this.foodId);
                console.log("UnLockDlg ----------------- UnLockDlg" + GameDataValue.getLastLv(), this.foodId);
                var o = CacheDataManager.getFoodCost(this.foodId, e);
                if (CacheDataManager.checkCost(t, o)) {
                    var a = CacheDataManager.reduceCost(CacheDataManager.getCoinCount(), o);
                    CacheDataManager.setCoinCount(a);
                    TaskGameEvent.emit(TaskGameEvent.upLevelFood, this.foodId);
                    CacheDataManager.updateCostDataView = !0;
                    switch (GameDataValue.getLastLv()) {
                        case 0:
                            "101" == this.foodId && QReport.sendOnce("1009");
                            break;
                        case 1:
                            "102" == this.foodId && QReport.sendOnce("100101");
                            "103" == this.foodId && QReport.sendOnce("100201");
                    }
                }
            };
            e.prototype.updateView = function () {
                var t = CacheDataManager.getFoodLevel(this.foodId),
                    e = CacheDataManager.getFoodCost(this.foodId, t);
                this.btnLockLab.string = ParseTool.parseAbc(e) + "";
                for (
                    var o = CacheDataManager.getCoinCount(),
                        a = CacheDataManager.checkCost(o, e),
                        i = this.unlockBtn.getComponentsInChildren(cc.RenderComponent),
                        n = 0;
                    n < i.length;
                    n++
                )
                    CacheDataManager.setSpriteMat(i[n], a);
            };
            n([p(cc.Node)], e.prototype, "unlockBtn", void 0);
            n([p(cc.Label)], e.prototype, "btnLockLab", void 0);
            return n([c], e);
        })(r.default));
o.default = l;
